package chapter04.exercise;

/**
 * @author cinyi
 */
public class Fibonacci {

    static {
        System.out.println("static");
    }

    /**
     * 斐波那契数列 练习
     *
     * @param fi 显示多少位
     */
    public static void fibonacci(int fi) {
        int x = 1, y = 1;
        System.out.print("1" + " " + "1");
        for (int i = 0; i < fi - 2; i++) {
            int temp = x;
            x = y;
            y += temp;
            System.out.print(" " + y);
        }

    }

    /**
     * 吸血鬼数练习
     */
    public static void xixuegui() {

        for (int i = 10; i < 100; i++) {
            for (int j = 10; j < 100; j++) {
                if (i % 10 == 0 && j % 10 == 0) {
                    continue;
                }
                if (i * j > 9999 || i * j < 1000) {
                    continue;
                }
                System.out.println(i * j + " = " + i + " * " + j);
            }
        }

    }

    public static void main(String[] args) {
//		xixuegui();
        System.out.println("main");
    }

}
